#ifndef __MYSTRING_H_
#define __MYSTRING_H_

class MyString
{
public:
   MyString():size(0),capacity(15){}   // 无参构造
   MyString(const char *s);   // 带参构造
   MyString(const MyString& String);
   MyString& operator=(const MyString&string);
   ~MyString();     // 析构

   MyString& operator+=(const MyString &string);
   MyString& operator+=(const char *c);
   MyString operator+(const MyString &string);
   MyString& operator-=(const MyString &string);
   MyString operator-(const MyString &string);

   char &MyString operator[](int index);
   
   bool operator==(const MyString &string); 
   bool operator!=(const MyString &string); 

   operator int();
   operator double();

   friend std::ostream& operator<<(std::ostream &os,const MyString& string);
   friend std::istream& operator>>(std::istream &is,const MyString& string);
  
private:
   char *s;
   int size;
   int capacity;
};

std::ostream& operator<<(std::ostream &os,const MyString& string);
std::istream& operator>>(std::istream &is,const MyString& string);


class MyStringArray
{
public:
   MyStringArray();
   MyStringArray(const MyString &string);
   MyStringArray(const MyStringArray &a);
   MyStringArray operator=(const MyStringArray &a);
   ~MyStringArray();

   
private:
   char *s;
   int size;
   int capacity;
};
#endif
